﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Operations;

namespace Mes.Application.Web.Validators.Operations.StdOper
{
    public class StdOperInputValidator : AbstractValidator<StdOperInput>
    {
        public StdOperInputValidator()
        {
            RuleFor(x => x.Oper_Id)
                .NotEmpty().WithMessage("Oper_Id不能为空")
                .MinimumLength(1).WithMessage("Oper_Id长度不能小于1")
                .MaximumLength(64).WithMessage("Oper_Id长度不能大于64")
                .Length(1, 64);

            RuleFor(x => x.Oper_Desc)
                .NotEmpty().WithMessage("Oper_Desc不能为空")
                .MinimumLength(2).WithMessage("Oper_Desc长度不能小于2")
                .MaximumLength(255).WithMessage("Oper_Desc长度不能大于255")
                .Length(2, 255);
        }
    }
}
